<%@page import="com.bean.Dept"%>
<%@page import="com.emp.database.EmpOperate,java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function checkDel(deptno){
		if(confirm("确定删除吗")){
			window.location.href="delDept?deptno="+deptno;
		}
	
	}
</script>
</head>
<body>
	
	<input type="button" value="添加部门信息"  onclick="javaScript:window.location.href='dept/addDept.jsp'">
		
	<table border="1" width="100%" cellpadding="0" cellspacing="0">
		
		<tr>
			<td>部门编号</td>
			<td>部门名称</td>
			<td>工作地点</td>
			<td>操作</td>
		</tr>
		<c:forEach var="dept" items="${delist }" varStatus="vs">
		<tr bgcolor="${vs.index%2==0 ? '#E8F2FE' : '#CDCDCD' }">
			<td>${dept.deptno }</td>
			<td>${dept.dname }</td>
			<td>${dept.loc }</td>
			<td>
				<a href="upDept?deptno=${dept.deptno }">修改</a>/
				<a href="javaScript:void(0)" onclick="checkDel(${dept.deptno })" >删除</a>
			</td>
		</tr>
		</c:forEach>
	</table>
	<div align="center" style="margin-top: 10px ">
		当前${currentPage }页/共${lasePage }页
		<c:if test="${currentPage != 1 }">
		<a href="ManagerDept?currentPage=1">首页</a>
		<a href="ManagerDept?currentPage=${currentPage-1 }">上一页</a>
		</c:if>
		
		<c:if test="${currentPage != lastPage }">
		<a href="ManagerDept?currentPage=${currentPage+1 }">下一页</a>
		<a href="ManagerDept?currentPage=${lasePage }">尾页</a>
		</c:if>
	</div>
</body>
</html>